package demo.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import demo.dao.StudentDao;
import demo.entity.Student;

import java.util.List;

@Service
public class StudentService {

	@Autowired
	private StudentDao studentDao;

	public List<Student> queryAllStudents() {
		return studentDao.queryAllStudents();
	}
	
	public Student queryStudentById(int id) {
		return studentDao.queryStudentById(id);
	}

	public Student insertStudent(Student student) {
		return studentDao.insertStudent(student);
	}

	public Student updateStudentById(int id, Student student) {
		return studentDao.updateStudentById(id, student);
	}

	public void deleteStudentById(int id) {
		studentDao.deleteStudentById(id);
	}
}
